//
//  SFileTools.m
//  SDownLoader
//
//  Created by Song on 2017/7/12.
//  Copyright © 2017年 Song. All rights reserved.
//  主要负责文件处理

#import "SFileTools.h"

@implementation SFileTools

+(BOOL)fileExists:(NSString *)filePath {
    
    if (filePath.length == 0) {
        return NO;
    }
    
   return [[NSFileManager defaultManager] fileExistsAtPath:filePath];
}

+(long long)fileSize:(NSString *)filePath {
    
    if (![self fileExists:filePath]) {
        return 0;
    }
    
   NSDictionary* fileInfo = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil];

    return [fileInfo[NSFileSize] longLongValue];
}

@end
